package com.lingyue.entity.module.api.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.lingyue.entity.dto.CustomerRoleDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 
 * </p>
 *
 * @author Baijinhua
 * @since 2020-04-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("api_customer_ownership")
@ApiModel(value="ApiCustomerOwnershipEntity对象", description="")
public class ApiCustomerOwnershipEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "API_COS_ID", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "经销商编号")
    @TableField("API_COS_DEL_ID")
    @JsonProperty("dealer_id")
    @NotNull(message = "dealer_id not be empty")
    private Long delId;

    @ApiModelProperty(value = "车辆数据唯一值")
    @TableField("API_COS_VEHICLE_UNIQUE_KEY")
    @JsonProperty("vehicle_unique_key")
    @NotBlank(message = "vehicle_unique_key not be empty")
    private String vehicleUniqueKey;

    @ApiModelProperty(value = "车架号")
    @TableField("API_COS_VIN")
    @NotBlank(message = "vin not be empty")
    private String vin;

    @ApiModelProperty(value = "客户列表")
    @Valid
    @NotEmpty(message = "customers not be empty")
    @TableField(exist = false)
    private List<CustomerRoleDTO> customers;

    @ApiModelProperty(hidden = true)
    @TableField("API_COS_CUSTOMERS")
    private String customerItems;

    @ApiModelProperty(value = "处理标识；C-create；U-update；D-delete；", hidden = true)
    @TableField("API_COS_HANDLER_FLAG")
    private String handlerFlag;

    @ApiModelProperty(value = "数据来源", hidden = true)
    @TableField("API_COS_DATA_SOURCE")
    private String dataSource;

    @ApiModelProperty(value = "请求流水号", hidden = true)
    @TableField("API_COS_REQUEST_NO")
    private String requestNo;

    @TableField("API_COS_CREATE_DATE")
    private LocalDateTime createDate;

    @TableField("API_COS_CREATE_USER")
    private String createUser;

    @ApiModelProperty(value = "消费状态：init-初始化、finished-完成",hidden = true)
    @TableField("API_COS_CONSUME_FLAG")
    private String consumeFlag;


    public static final String API_COS_ID = "API_COS_ID";

    public static final String API_COS_DEL_ID = "API_COS_DEL_ID";

    public static final String API_COS_CUSTOMER_UNIQUE_KEY = "API_COS_CUSTOMER_UNIQUE_KEY";

    public static final String API_COS_VEHICLE_UNIQUE_KEY = "API_COS_VEHICLE_UNIQUE_KEY";

    public static final String API_COS_CUSTOMER_ID = "API_COS_CUSTOMER_ID";

    public static final String API_COS_VIN = "API_COS_VIN";

    public static final String API_COS_ROLES = "API_COS_ROLES";

    public static final String API_COS_HANDLER_FLAG = "API_COS_HANDLER_FLAG";

    public static final String API_COS_DATA_SOURCE = "API_COS_DATA_SOURCE";

    public static final String API_COS_REQUEST_NO = "API_COS_REQUEST_NO";

    public static final String API_COS_CREATE_DATE = "API_COS_CREATE_DATE";

    public static final String API_COS_CREATE_USER = "API_COS_CREATE_USER";

    public static final String API_COS_CONSUME_FLAG = "API_COS_CONSUME_FLAG";

}
